/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ${USER}
 * Date: ${YEAR}-${MONTH}-${DAY}
 * Time: ${TIME}
 */
public class Main {
    public static void main(String[] args) {
        System.out.println("================泛型================");
        Test4 test41 = new Test4();
        String method = test41.method();
        System.out.println(method);//重写了接口的方法返回一个String字符串
        Test5<String,Integer> test5 = new Test5<>("count",1000);
//        test5.setValue("count2");   应该用get方法
//        test5.setCount(999);
        Integer count = test5.getCount();
        String value = test5.getValue();
        System.out.println(value+"="+count);
    }
    public static void main1(String[] args) {
        Test3<String> test3 = new Test3<String>();
        String[] strproducts = {"盲盒","电脑","手机","扫地机器人","水杯"};
        for (int i = 0; i < strproducts.length; i++) {
            test3.addproduct(strproducts[i]);//调用new好的对象的add方法 遍历数组将所有元素存进去

        }
        String product1 = test3.getProduct();
        System.out.println("恭喜您获得了" + product1);
        System.out.println("================================");

        Test3<Integer> test4 = new Test3<Integer>();
        Integer[] intproducts = {1213,99999,77777,66666};
        for (int i = 0; i < intproducts.length; i++) {
            test4.addproduct(intproducts[i]);
        }
        Integer product2 = test4.getProduct();//将新new的 test4的get方法里获取的
        // 奖金奖品存到product2中
        System.out.println("恭喜你获得了奖金"+product2);//不能打印intproducts了这个数组已经完成任务了

//        Test3<Double> test5 = new Test3<Double>();
//        Double[] doubles = {100.99,33.777,24.8888};
//        for (int i = 0; i < doubles.length; i++) {
//            test5.addproduct(doubles[i]);
//        }
        Test3<Double> test5 = new Test3<>();//double类型
        Double[] doubles = {1.111,3.333,6.66666,7.777};
        for (int i = 0; i < doubles.length; i++) {
            test5.addproduct(doubles[i]);
        }
        Double product3 = test5.getProduct();
        System.out.println("恭喜您获得小奖金："+product3);




    }
}